<!DOCTYPE html>
<html>
<head>
    <title>更改挂号--中软高科-2015</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="../Css/style.css" />
    <script type="text/javascript" src="../Js/jquery.js"></script>
    <script type="text/javascript" src="../Js/jquery.sorted.js"></script>
    <script type="text/javascript" src="../Js/bootstrap.js"></script>
    <script type="text/javascript" src="../Js/ckform.js"></script>
    <script type="text/javascript" src="../Js/common.js"></script>
    <script type="text/javascript" src="../Js/ckeditor/ckeditor.js"></script>
 

    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
    <script type="text/javascript">
    $(function () {       
		$('#backid').click(function(){
				window.location.href="index.html";
		 });
    });
    </script>
</head>
<body>
<form action="index.html" method="post" class="definewidth m20">
<table class="table table-bordered table-hover definewidth m10">
    <tr>
        <td width="10%" class="tableleft">姓名</td>
        <td><input type="text" name="patientName" value=""/></td>
    </tr>

    <tr>
        <td width="10%" class="tableleft">身份证号</td>
        <td><input type="text" name="patientIdCard" value=""/></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">社保号</td>
        <td><input type="text" name="patientSocietyId" value=""/></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">挂号费</td>
        <td><input type="text" name="expense" value=""/>元</td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">联系电话</td>
        <td><input type="text" name="patientPhoneNum" value=""/></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">是否自费</td>
        <td><input type="radio" name="expenseWay" value="否" checked/>否&nbsp;&nbsp;&nbsp;<input type="radio" name="expenseWay" value="是"/>是</td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">性别</td>
        <td><input type="radio" name="patientGender" value="男" checked/>男&nbsp;&nbsp;&nbsp;<input type="radio" name="patientGender" value="女"/>女</td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">年龄</td>
        <td><input type="text" name="patientAge" value=""/></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">职业</td>
        <td><input type="text" name="patientWork" value=""/></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">初复诊</td>
        <td><input type="radio" name="patientFirst" value="初诊" checked/>初诊&nbsp;&nbsp;&nbsp;<input type="radio" name="patientFirst" value="复诊"/>复诊</td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">所挂科室</td>
        <td><select id="selected01" name="patientDept"></select></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">指定医生</td>
        <td><select id="selected02" name="doctor"></select></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">状态</td>
        <td><select  name="status"><option value="0">已挂号</option><option value="1">已住院</option></select></td>
    </tr>
	<tr>
        <td width="10%" class="tableleft">备注</td>
        <td><input type="text" name="patientTip"></td>
	</tr>
    <tr>
        <td colspan="2">
			<center>
				<button  class="btn btn-primary" type="button" onclick="addPatient()">保存</button> &nbsp;&nbsp;<button type="button" class="btn btn-success" name="backid" id="backid" onclick="toIndex()">返回列表</button>
			</center>
		</td>
    </tr>
</table>
</form>
<script>

    //dept下拉框填充
    $.ajax({
        url:"/dept/editList",
        method:"GET",
        dataType:"json",
        success:function (vo){
            var list = vo.list;
            for(var i = 0;i<list.length;i++){
                var deptName = list[i].deptName;
                var option = $("<option>").val(deptName).text(deptName);
                $("#selected01").append(option);
            }
        }
    })
//医生select下拉框填充
    $.ajax({
        url:"/Info/doctors",
        method:"GET",
        dataType:"json",
        success:function (vo){
            var list = vo.list;
            for(var i = 0;i<list.length;i++){
                var doctorName = list[i].doctorName;
                var option = $("<option>").val(doctorName).text(doctorName);
                $("#selected02").append(option);
            }
        }
    })

    function addPatient(){

        $.ajax({
            url:"/patient/addPatient",
            data: $("form").serialize(),
            method:"POST",
            success:function (vo){
                alert(vo.msg);
                toIndex();
            }
        })

    }
    function toIndex(){
        window.location.href="/Registration/index.html";
    }
</script>
</body>
</html>